import request from '@/http/index'
import { ElectricalFormulaListParam, ElectricalFormula } from './type'

// 获取电气公式列表
export const getListApi = (params: ElectricalFormulaListParam) => {
  return request.get('/electricalFormula/getElectricalFormulaList', params)
}

// 新增电气公式
export const addApi = (data: ElectricalFormula) => {
  return request.post('/electricalFormula/createElectricalFormula', data)
}

// 编辑电气公式
export const editApi = (data: ElectricalFormula) => {
  return request.put('/electricalFormula/updateElectricalFormula', data)
}

// 删除电气公式
export const deleteApi = (id: number) => {
  return request.delete(`/electricalFormula/deleteElectricalFormula/${id}`)
}

// 导入电气公式
export const importApi = (data: FormData) => {
  return request.upload('/electricalFormula/importElectricalFormula', data)
} 